# Maintainer: Ariadne Conill <ariadne@dereferenced.org>
pkgname=libucontext0
pkgver=0.13.1
pkgrel=0
pkgdesc="ucontext function implementations compat for abi version 0"
url="https://github.com/kaniini/libucontext"
arch="all"
license="ISC"
source="https://distfiles.dereferenced.org/libucontext/libucontext-$pkgver.tar.xz"
replaces=libucontext
builddir="$srcdir"/libucontext-$pkgver

case "$CTARGET_ARCH" in
	arm*)		LIBUCONTEXT_ARCH="arm" ;;
	ppc64le)	LIBUCONTEXT_ARCH="ppc64" ;;
	*)		LIBUCONTEXT_ARCH="$CTARGET_ARCH" ;;
esac

build() {
	make ARCH="$LIBUCONTEXT_ARCH"
}

check() {
	make ARCH="$LIBUCONTEXT_ARCH" check
}

package() {
	install -Dm644 libucontext.so.0 "$pkgdir"/usr/lib/libucontext.so.0
}

sha512sums="b39c9b97bb64054ac1a95ab2f531977e9db6e6cb5ffbbc7f22e129000b0e9418331bd6b9620f1b77d0fd5df5679b4d785e0c47ab6581baed10a1905cddd9ca7b  libucontext-0.13.1.tar.xz"
